//
//  MBBaseTableViewCell.m
//  MemberBusiness-ios
//
//  Created by cherry pu on 2018/4/19.
//  Copyright © 2018年 zhangXin. All rights reserved.
//

#import "MBBaseTableViewCell.h"

@interface MBBaseTableViewCell ()
@property (nonatomic,strong) MBBaseTableCellViewModel *viewModel;

@end


@implementation MBBaseTableViewCell

+ (instancetype)cellForTableView:(UITableView *)tableView viewModel:(MBBaseTableCellViewModel *)viewModel
{
    NSString *identify = NSStringFromClass([self class]);
    MBBaseTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identify];
    if (!cell) {
        cell = [[self alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identify];
        [cell setupLayout];
        [cell setupBinding];
    }
    cell.viewModel = viewModel;
    [cell setupData];
    return cell;
}

// cell里面实现，通过viewModel去存储数据，高度由这个Block返回给ViewModel保存起来
+ (NSNumber*)calculateRowHeightWithViewModel:(MBBaseTableCellViewModel *)viewModel
{
    return nil;
}


- (void)setupLayout
{
    
}

- (void)setupBinding{
}

- (void)setupData
{
    
}

@end
